local blaze = require "blaze"
local gamelib = require "club.threecard.gamelib"
local monoevent = blaze.monoevent
local GameManager = gamelib.require "GameCore.GameManager"

local GameLoadingUI = gamelib.ui.activity()

function GameLoadingUI:ctor()
    self.res = "club.threecard.gamelib/ui/gameloading.b:GameLoadingUI"
end

function GameLoadingUI:on_injected(bind)
    monoevent.on(self.gameobject, "Update", function() self:OnUpdate() end);
end

function GameLoadingUI:OnUpdate()
    self.progress_image.fillAmount = GameManager.progress;
end

function GameLoadingUI:on_release()
    monoevent.off(self.gameobject, "Update", function() self:OnUpdate() end);
end

return GameLoadingUI